<#include "../../ajaxPage.ftl" />
<#include "../../display.ftl" />
<table class="table table-datatable table-gray">
    <input type="hidden" id="selectCardId" name="cardId"/>
    <input type="hidden" id="selectCustomerName" name="customerName"/>
    <thead>
    <tr>
        <th>员工号</th>
        <th>员工状态</th>
        <th>员工姓名</th>
        <th>性别</th>
        <th>身份证号码</th>
        <th>本人联系电话</th>

    </tr>
    </thead>
    <tbody>
        <#if hrEmployeesTable.rows??>
        <#list hrEmployeesTable.rows as hrEmployee>
         <tr onclick="selectArow(this);">
             <td>${hrEmployee.employeeId!''}</td>
             <td><@display list=employeeTypeList value="${hrEmployee.employeeState!''}"/> </td>
             <td>${hrEmployee.employeeName!''}</td>
             <td><@display list=sexTypeList value="${hrEmployee.sex!''}"/> </td>
             <td>${hrEmployee.card!''}</td>
              <td>${hrEmployee.phone!''}</td>


        </tr>
        </#list>
    </#if>
    </tbody>
</table>

<#if hrEmployeesTable??>
    <@page table=hrEmployeesTable formId="search_hrEmployee_select" contentId="selectContent"/>
</#if>
<script>
    $(function () {
        $("table tbody tr").click(function () {
            $("table tbody tr").removeClass("active");
            $(this).addClass("active");
            var cardId = $(this).children("td:eq(0)").text();
            var customerName = $(this).children("td:eq(2)").text();
            if (cardId != "" && customerName != "") {
                $("#selectCardId").val(cardId);
                $("#selectCustomerName").val(customerName);
            }
        });
    });
</script>